package com.example.planschedulingsystem.repository;

import com.example.planschedulingsystem.entity.PlaneTrip;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.List;

@Repository
public interface PlaneTripRepository extends CrudRepository<PlaneTrip, Long> {

    List<PlaneTrip> findPlaneTripsByPlane_IDAndDeparturetimeAfterAndDeparturetimeBeforeOrderByDeparturetimeAsc(Long planeSeq, Timestamp after, Timestamp before);

    List<PlaneTrip> findAllByDeparturetimeAfterAndDeparturetimeBeforeOrderByDeparturetimeAsc(Timestamp after, Timestamp before);

    Long deletePlaneTripByID(Long ID);

    Long deletePlaneTripsByPlane_ID(Long ID);

}
